<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use HasFactory;

    protected $table = 'users';
    protected $primaryKey = 'id';
    public $timestamps = true;
    protected $guarded = [];

    public function collections()
    {
        return $this->hasMany(UserCollection::class, 'user_id', 'id');
    }

    public function orders()
    {
        return $this->hasMany(UserOrder::class, 'user_id', 'id');
    }

    public function subcribes()
    {
        return $this->hasMany(UserSubcribe::class, 'user_id', 'id');
    }

    public function contents()
    {
        return $this->hasMany(Content::class, 'user_id', 'id');
    }

    public function Messages()
    {
        return $this->hasMany(Message::class, 'user_id', 'id');
    }

    public function resume()
    {
        return $this->hasOne(Resume::class, 'user_id', 'id');
    }

}
